import qs from 'qs'
import request from './request'

export function userlogin(params) {
    return request({
        url: `/User/login`,
        method: 'post',
        data: qs.stringify(params),
    })
}
export function userRegister(params) {
    return request({
        url: `/User/register`,
        method: 'post',
        data: qs.stringify(params),
    })
}
//文物筛选返回数据接口
export function searchRelics(params) {
    return request({
        url: `/User/searchRelics`,
        method: 'post',
        data: qs.stringify(params),
    })
}
//文物年代分类数据
export function searchDecade() {
    return request({
        url: `/User/searchDecade`,
        method: 'post',
    })
}
//文物地域分类数据
export function searchLocal() {
    return request({
        url: `/User/searchLocal`,
        method: 'post',
    })
}
//文物材质分类数据
export function searchTypes() {
    return request({
        url: `/User/searchTypes`,
        method: 'post',
    })
}
//文物收藏
export function collectionRelic(params) {
    return request({
        url: `/User/collectionRelic`,
        method: 'post',
        data: qs.stringify(params),
    })
}
//收藏文物
export function searchCollection(params) {
    return request({
        url: `/User/searchCollection`,
        method: 'post',
        data: qs.stringify(params),
    })
}

//删除收藏的文物
export function deleteCollection(params) {
    return request({
        url: `/User/deleteCollection`,
        method: 'post',
        data:qs.stringify(params,{arrayFormat: 'indices', allowDots: true}),
    })
}

//输入关键词筛选个人的收藏文物
export function SearchCollectionRelic(params) {
    return request({
        url: `/User/SearchCollectionRelic`,
        method: 'post',
        data:qs.stringify(params,{arrayFormat: 'indices', allowDots: true}),
    })
}

//输入关键词筛选文物
export function Search(params) {
    return request({
        url: `/User/Search`,
        method: 'post',
        data:qs.stringify(params),
    })
}

//文物相关推荐
export function Recommend(params) {
    return request({
        url: `/User/Recommend`,
        method: 'post',
        data:qs.stringify(params),
    })
}
//上传用户头像
export function uploadHeadImage(formData) {
    return request({
        url: `/User/uploadHeadImage`,
        method: 'post',
        data:formData
    })
}

//上传用户头像
export function updatePassword(params) {
    return request({
        url: `/User/updatePassword`,
        method: 'post',
        data:qs.stringify(params),
    })
}

//智能检索接口
export function smartSearch(params) {
    return request({
        url: `/Smart/smartSearch`,
        method: 'post',
        data: qs.stringify(params),
    })
}
